﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<ToppingControl.Models.TopCordBomModel.TopCordBom_DS>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Index
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
 <div><h2>Topped Cord BOM</h2></div>
 </asp:Content>


<asp:Content ID="Content4" ContentPlaceHolderID="TableContent" runat="server">
   <style type="text/css">
   .right
   {
      text-align:right!important;
   }
   </style>
   <table width="100%" id="dg">
   <thead>
         <tr class="head"  id="trRow">
            <td class="cell txt" style="width: 250px;">Topped Code</td>
            <td class="cell txt" style="width: 250px;">Tire Cord</td>
            <td class="cell txt" style="width: 250px;">IRC Cord</td>
            <td class="cell txt" style="width: 250px;">Compound</td>
            <td class="cell txtn" style="width: 175px;">STD Formular M./Kg.</td>  
            <td class="cell" style="text-align:center; width:50px;" >DELETE</td>
         </tr>
         
      </thead>
      
       <tbody>
         <%
            int i = 0;
            
            foreach (var item in Model)
            {
               i = i + 1;
              
         %>
         
         <tr class="rowa"  style="line-height:25px;">
          
            <td class="cell" style="width: 50px; text-align:center;">
             <%= item._Topcrdcd%>
            </td>
            <td style="width: 250px; text-align:center;" class="cell">
             <input type="text" value="<%= item._Tcrdcd %>"  style="width:97%;" maxlength="30" />
            </td>
            <td style="width: 250px; text-align:center;" class="cell txt">
               <input type="text" value="<%= item._Irccrdcd%>"  style="width:97%;" maxlength="30" />
            </td>
            <td style="width: 250px;" class="cell txt">
               <input type="text" value="<%= item._Compcd %>" style="width:97%;" maxlength="30"/>
            </td>
            <td style="width: 175px; text-align:center;" class="cell txtn">
              <input type="text" value="<%= item._Stdform %>" style="width:57%;" maxlength="6" class="right"/>
            </td>                       
           
            <td style="width: 50px; text-align:center;" class="cell">
            
             <img src="<%: Url.Content("~/Images/action_delete.png") %>" class="del" alt='' />            
              
            </td>
         </tr>
         <% }  %>
        
      </tbody>
   </table>
</asp:Content>

<asp:Content ID="Content5" ContentPlaceHolderID="ScriptsSection" runat="server">
    <% if (false) { %>
   <script src="../../Scripts/jquery-1.7.2.js" type="text/javascript"></script>
   <% } %>
   <script type="text/javascript">
      $(function () {
         /******* CREATE ROW **********/
         function CreatTR() {
            var tr = $("#dg tr.head").clone(true).removeClass("head").addClass("rowa").removeAttr("id");
            tr.find(".cell").each(function () {
               if ($(this).hasClass("txt")) {
                  $(this).html(txt.format('', 30, 97));
               }
               if ($(this).hasClass("txtn")) {
                  $(this).html(txt.format('', 6, 57));
                  $(this).find("input:text").setMask("999.99").addClass("right");
               }
            });
            var p = '<%: Url.Content("~/Images/action_delete.png") %>'
            tr.find("td:last").html("<img class='del' src='" + p + "' />");
            return tr;
         }

         /******* SET INITAIL **********/
         setTimeout(function () {

            if ($("#dg tr.rowa:first").length <= 0) {
               $("#dg").append(CreatTR());
            } else {
               $("#dg td.txtn").each(function () {
                  $(this).find("input:text").setMask("999.99");

               });
            }
         }, 500)

      });
    </script>  
</asp:Content>
